package com.park.dao;

import java.util.Date;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.park.model.ChargeRecord;
import com.park.model.Park;
import com.park.model.ParkRecordData;
import com.park.model.PosChargeData;
import com.park.model.ParkRecordData;

public interface ParkRecordDataMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(ParkRecordData record);

    int insertSelective(ParkRecordData record);

    ParkRecordData selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(ParkRecordData record);

    int updateByPrimaryKey(ParkRecordData record);
    
public List<Park> getParkByCountMoney(Map<String, Object> map);
	
	public String getByDateAndParkCountPayzbs(@Param("startDate")String startDate,@Param("endDate")String endDate);
	public String getByDateAndParkCountPayzje(@Param("startDate")String startDate,@Param("endDate")String endDate);
	public String getByParkpaidMoneyjine(@Param("startDate")String startDate,@Param("endDate")String endDate);
	public String getByDateAndParkCountPayTypebs(@Param("startDate")String startDate,@Param("endDate")String endDate,@Param("payType")int payType);
	public String getByDateAndParkCountPayTypeje(@Param("startDate")String startDate,@Param("endDate")String endDate,@Param("payType")int payType);
	public Map<String, Object> selectPosdataSumByParkAndRangeMoney(@Param("id")int id,@Param("startDay") String startDay, @Param("endDay") String endDay);
	
	public List<Park> getParkByMoney(Map<String, Object> map);
	
	public String getByDateAndParkCountzbs(@Param("parkId")int parkId,@Param("startDate")String startDate,@Param("endDate")String endDate);

	public String getByDateAndParkCountzje(@Param("parkId")int parkId,@Param("startDate")String startDate,@Param("endDate")String endDate);
	public String getBypaidMoneyjine(@Param("parkId")int parkId,@Param("startDate")String startDate,@Param("endDate")String endDate);
	public String getByDateAndParkCountbs(@Param("parkId")int parkId,@Param("startDate")String startDate,@Param("endDate")String endDate,@Param("payType")int payType);
	public String getByDateAndParkCountje(@Param("parkId")int parkId,@Param("startDate")String startDate,@Param("endDate")String endDate,@Param("payType")int payType);
	
	public ParkRecordData getById(int id);

	public List<ParkRecordData> get();
	
	public List<ParkRecordData> getPage(int low, int count);
	
	public List<ParkRecordData> getAllParkRecordData(@Param("value")String value,@Param("parkId")List<Integer> parkId,@Param("entranceDate")Date entranceDate,@Param("exitDate")Date exitDate);
	public List<ParkRecordData> getAll(@Param("value")String value,@Param("parkId")List<Integer> parkId,@Param("entranceDate")Date entranceDate,@Param("exitDate")Date exitDate);
	
	public List<ParkRecordData> getByParkIdAndCardNumber(@Param("parkId")int parkId,@Param("cardNumber")String cardNumber);
	
	public List<ParkRecordData> getByCardNumberAndPark(@Param("cardNumber")String cardNumber,@Param("parkId")int parkId);
	
	public List<ParkRecordData> getByCardNumberAndParkName(@Param("cardNumber")String cardNumber,@Param("parkName")String parkName,@Param("parkId")int parkId,@Param("operatorId")String operatorId);
	
	public List<ParkRecordData> getPageByParkId(@Param("parkId")int parkId,@Param("start")int start,@Param("count")int count);
	
	//public List<ParkRecordData> getByparkIdAndTimeAll(@Param("parkId")List<Integer> parkId,@Param("startDate")Date startDate,@Param("endDate")Date endDate);
	public Park getByparkIdAndTimeAll(@Param("parkId")int parkId,@Param("startDate")Date startDate,@Param("endDate")Date endDate);
	
	
	public List<ParkRecordData> getPageArrearage(int low, int count);
	
	public List<ParkRecordData> getPageArrearageByParkId(@Param("parkId")int parkId,@Param("start")int start,@Param("count")int count);
	
	public List<ParkRecordData> getByRange(@Param("parkId")int parkId,@Param("startDate")Date startDate,@Param("endDate")Date endDate);
	
	public List<ParkRecordData> getAllByDay(@Param("startDate")Date startDate,@Param("endDate")Date endDate);
	
	public List<ParkRecordData> getParkCarportStatusToday(@Param("parkId")int parkId,@Param("day")String day);
	
	public int count();
	
	public int gongcount();
	
	public int deleteById(@Param("id")int id);
	
	public int update(ParkRecordData item);
	
	public List<ParkRecordData> getDebt(String cardNumber);
	
	public List<ParkRecordData> getDebtWithParkId(@Param("carNumber")String carNumber,@Param("parkId")int parkId);

	public List<ParkRecordData> getLastRecord(@Param("carNumber")String carNumber,@Param("count")int count);
	
	public List<ParkRecordData> getLastRecordWithPark(@Param("carNumber")String carNumber,@Param("count")int count,@Param("parkId")int parkId);
	
	public List<ParkRecordData> getArrearageByCardNumber(String cardNumber);

	public List<ParkRecordData> getUnCompleted();
	
	public List<ParkRecordData> selectPosdataByParkAndRangeAndCarportNumber(@Param("startDay") Date startDay, @Param("endDay") Date endDay,@Param("parkId")int parkId,@Param("carportNumber")int carportNumber);
	
	public List<ParkRecordData> selectPosdataByParkAndRange(@Param("startDay") Date startDay, @Param("endDay") Date endDay,@Param("parkId")int parkId);
	
	public int deleteByParkIdAndDate(@Param("startDay") String startDay, @Param("endDay") String endDay,@Param("parkId")int parkId);
	
	public List<ParkRecordData> getByCardNumber(@Param("cardNumber")String cardNumber);
	
	public List<ParkRecordData> getByCardNumberAndPort(@Param("cardNumber")String cardNumber,@Param("portNumber")Integer portNumber);
	
	public List<ParkRecordData> getByParkName(@Param("parkName")String parkName);
	
	public List<ParkRecordData> getByCarNumberAndPN(@Param("cardNumber")String cardNumber,@Param("parkName")String parkName);
	
	public Map<String, Object> calInByParkAndRange(@Param("parkId")int parkId,@Param("startDate")Date startDate,@Param("endDate")Date endDate);
	
	public Map<String, Object> calInByParkAndRangeMoney(@Param("startDate")Date startDate,@Param("endDate")Date endDate);
	
	public Map<String, Object> calOutByParkAndRange(@Param("parkId")int parkId,@Param("startDate")Date startDate,@Param("endDate")Date endDate);
	
	public Map<String, Object> calOutByParkAndRangeMoney(@Param("startDate")Date startDate,@Param("endDate")Date endDate);
	
	public Map<String, Object> selectPosdataSumByParkAndRange(@Param("startDay") Date startDay, @Param("endDay") Date endDay,@Param("parkId")int parkId);
	
	public List<Map<String, Object>> getFeeOperatorChargeData(@Param("startDate") Date startDate, @Param("endDate") Date endDate);

	public List<ParkRecordData> getByParkDatetime(@Param("map")Map<String,Object> map);

	public List<ParkRecordData> getByParkId(@Param("map")Map<String, Object> map);
	public List<ParkRecordData> getAllParkCharge(@Param("parkIds")List<Integer> parkIds,@Param("conditionalvalue")String conditionalvalue,@Param("other")double other,@Param("paidCompleted")int paidCompleted,@Param("payType")int payType,@Param("entranceDatestr")Date entranceDatestr,@Param("exitDatestr")Date exitDatestr);
	public List<ParkRecordData> getAllParkChargeparkId(@Param("parkId")int parkId,@Param("conditionalvalue")String conditionalvalue,@Param("other")double other,@Param("paidCompleted")int paidCompleted,@Param("payType")int payType,@Param("entranceDatestr")Date entranceDatestr,@Param("exitDatestr")Date exitDatestr);

	public int getCount(@Param("map")Map<String, Object> map);

	public int getAllCount(@Param("map")Map<String, Object> map);

	public abstract List<ParkRecordData> getReviewList(@Param("parkId") int paramInt, @Param("other") double paramDouble, @Param("startDate") Date paramDate1, @Param("endDate") Date paramDate2, @Param("startPage")int i, @Param("pageSize")int count, @Param("cardNumber")String cardNumber);

	public List<ParkRecordData> getParkingByParkDatetime(@Param("map")Map<String, Object> map);

	public int getParkingAllCount(@Param("map")Map<String, Object> map);

	public List<ParkRecordData> getParkingByParkId(@Param("map")Map<String, Object> map);

	public int getParkingAllCountById(@Param("map")Map<String, Object> map);

	public ParkRecordData getByCardNumberV1(@Param("plateNumber")String plateNumber);

	public int updateClear(@Param("id")int id);

	public int updateClearV1(@Param("id")int id);

	public List<Map<String, Object>> getVehicleFlowData(@Param("pastTime")String pastTime, @Param("nowTime")String nowTime, @Param("parkIds")List<Integer> parkIds);

	public int getParkingVehicleData(@Param("pastTime")String pastTime, @Param("nowTime")String nowTime, @Param("parkIds")List<Integer> parkIds);

	public int getOff_siteVehicleData(@Param("pastTime")String pastTime, @Param("nowTime")String nowTime, @Param("parkIds")List<Integer> parkIds);

	public List<Map<String, Object>> getVehicleFlowDataOfDay(@Param("pastTime")String pastTime, @Param("nowTime")String nowTime,@Param("parkIds")List<Integer> parkIds);

	public double getChargeMoneyOfDay();

	public double getPaidMoneyOfDay(@Param("ids")List<Long> ids);

	public List<String> getDayTime();

	public List<Double> getWeekChargeMoney();

	public List<Double> getWeekPaidMoney(@Param("ids")List<Long> ids);
	
	public void updateByParkIdAndCardNumber(@Param("parkId")int parkId, @Param("cardNumber")String cardNumber);

	public List<ParkRecordData> getByCardNumberAndParkV1(@Param("cardNumber")String cardNumber, @Param("parkId") int parkId);

	public int getReviewListCount(@Param("parkId") int paramInt, @Param("other") double paramDouble, @Param("startDate") Date paramDate1, @Param("endDate") Date paramDate2, @Param("cardNumber")String cardNumber);

	public List<PosChargeData> getDebtWithParkIdV1(@Param("carNumber")String cardNumber, @Param("parkId")Integer parkId);

	public List<ChargeRecord> getChargeRecord(@Param("startPage")int i, @Param("pageSize")int pageSize, @Param("account")String account, @Param("name")String name, @Param("startTime")Date parse,
			@Param("endTime")Date parse2);

	public int getChargeRecordAllCount(@Param("account")String account, @Param("name")String name, @Param("startTime")Date parse,
			@Param("endTime")Date parse2);

	List<PosChargeData> getAllParkRecord(@Param("ids")List<Long> ids, @Param("parkId")int parkId, @Param("entranceStart1")Date entranceStart1, @Param("entranceEnd1")Date entranceEnd1, 
			@Param("exitStart1")Date exitStart1,
			@Param("exitEnd1")Date exitEnd1, @Param("plateNumber")String plateNumber, @Param("portNumber")String portNumber, @Param("operatorId")String operatorId);

	double getAllPaidMoney();

	int insertV2(PosChargeData charge);

	List<PosChargeData> getLastRecordWithParkV1(@Param("carNumber")String carNumber,@Param("count")int count,@Param("parkId")int parkId);
}